# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=iniparser
pkgver=4.1
pkgrel=3
pkgdesc="C library for parsing INI-style files"
url="http://ndevilla.free.fr/iniparser/"
arch="all"
license="MIT"
makedepends="bash"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/ndevilla/iniparser/archive/v$pkgver.tar.gz
	CVE-2023-33461.patch
	rpath.patch
	"

# secfixes:
#   4.1-r3:
#     - CVE-2023-33461

build() {
	make
}

check() {
	make check
}

package() {
	install -d "$pkgdir"/usr/lib "$pkgdir"/usr/include
	install -m 644 src/dictionary.h "$pkgdir"/usr/include/dictionary.h
	install -m 644 src/iniparser.h "$pkgdir"/usr/include/iniparser.h
	install -m 755 libiniparser.so.1 "$pkgdir"/usr/lib/libiniparser.so.1
	ln -s libiniparser.so.1 "$pkgdir"/usr/lib/libiniparser.so
}

sha512sums="
a8125aaaead1f9dfde380fa1e45bae31ca2312be029f2c53b4072cb3b127d16578a95c7c0aee1e3dda5e7b8db7a865ba6dfe8a1d80eb673061b3babef744e968  iniparser-4.1.tar.gz
d2becc2fdbe5a57c7bdd05c61ba4f5a199c43fac55cd98c9b54e11ca06d74d5c592e7fea86c634c91db92c74fa3ec95abad379ff4caa4c79449198528d5b6e48  CVE-2023-33461.patch
db7bdab6f8faafd47c8b50104e1a461fbd9324b75482b1455a8fc059c07278e7e60f088a3f712b0ade05a9bb989168d17684455b9863018f22a61e0190a888c6  rpath.patch
"
